import 'package:demo/app/global.dart';
import 'package:demo/app/modules/main/main_controller.dart';
import 'package:get/get.dart';

import '../../../../model/agreement_model.dart';
import '../../../routes/app_pages.dart';
import '../../../widgets/CommonDialog.dart';

class MineController extends MainController {

  /// 协议中心
  void toAgreementCenter(){
    var agreementList = <Agreement>[];
    agreementList.add(Agreement(url:Global.getAgreementUser(),name: Global.agreementUserTitle));
    agreementList.add(Agreement(url:Global.getAgreementPolicy(),name: Global.agreementPolicyTitle));
    var map = {
      'title': '协议中心',
      'list': agreementList,
    };
    Get.toNamed(Routes.AGREEMENT_LIST, arguments: map);
  }

  /// 注销
  void toCancel(){
    Get.toNamed(Routes.CANCEL);
  }

  /// 退出登录
  void logout(){
    Get.dialog(
      CommonDialog(
        contentStr:'您确定要退出登录吗？',
        yesFun: ()=> Get.offAllNamed(Routes.LOGIN),
      ),
    );
  }
}
